/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.pokemon.dao;

import com.pokemon.entities.Pokemon;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;

/**
 *
 * @author Martin Strasek
 */
public interface PokemonDAO {
    
    /**
     * Adds pokemon into database.
     * 
     * @param pokemon PokemonDTO added into database 
     */
    void addPokemon(Pokemon pokemon);
    
    /**
     * Gets pokemon by given id.
     * 
     * @param id Id of finding pokemon 
     * @return pokemon by given id
     */
    Pokemon getPokemon(Long id);
    
    /**
     * Updates given pokemon in database
     * 
     * @param pokemon Updated pokemon
     */
    void updatePokemon(Pokemon pokemon);
    
    /**
     * Removes given pokemon from database
     * 
     * @param pokemon PokemonDTO removed from the database
     */
    void removePokemon(Pokemon pokemon);
    
    /**
     * Gets list of all pokemons in the database
     * 
     * @return List of all pokemons in the database. If the database is empty returns empty list.  
     */
    List<Pokemon> getAllPokemons();
    
    /**
     * Method sets entity manager factory.
     * 
     * @param entityManagerFactory
     */
    void setEntityManagerFactory(EntityManagerFactory entityManagerFactory);
    
    void setEm(EntityManager entityManager);
}
